package com.sss.springcloud.controller;

import com.sss.springcloud.common.Result;
import com.sss.springcloud.entities.Payment;
import com.sss.springcloud.service.PaymentFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @author sss
 * @date 2020-03-05 19:34
 **/
@RestController
public class OrderFeignController {

    @Resource
  private PaymentFeignService paymentFeignService;

    @GetMapping("/payment/feign/get/{id}")
    public Result getPayment(@PathVariable Long id){
        return paymentFeignService.getPayment(id);
    }

    @GetMapping("/payment/feign/timeout")
    public Result getTimeout(){

        return  paymentFeignService.getTimeout();
    }
}
